<template>
    <div class="app-container">
        <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
                <el-button
                    type="primary"
                    plain
                    size="mini"
                    @click="handleMockData"
                >生成随即数据</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-input v-model="id">
                </el-input>
            </el-col>
            <el-col :span="1.5">
                <el-button
                    type="success"
                    plain
                    size="mini"
                    @click="handleQueryId"
                >查询健康码</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button
                    type="success"
                    plain
                    size="mini"
                    @click="handleQueryTotal"
                >缓存记录数</el-button>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="24">
                提示: {{msg}}
            </el-col>
        </el-row>
    </div>

</template>

<script>
import request from "../../../utils/request";

export default {
    name: "healthCodePage",
    data(){
        return {

            msg: undefined,
            id: '331003198801010011',
        }
    },
    methods: {
        // 打开加载层
        openLoading() {
            this.$modal.loading("正在加载缓存监控数据，请稍候！");
        },
        handleMockData(){
            request({
                isLoading: true,
                url: '/anon/test/mockData',
                method: 'get',
                headers:{
                    isToken: false,
                }
            }).then(res=>{
                this.msg=res.msg
            })
        },
        handleQueryId(){
            request({
                isLoading: true,
                url: '/anon/test/personCode',
                method: 'get',
                params:{
                    id: this.id,
                },
                headers:{
                    isToken: false,
                }
            }).then(res=>{
                this.msg=res.data
            })
        },
        handleQueryTotal(){
            request({
                isLoading: true,
                url: '/anon/test/queryTotal',
                method: 'get',
                headers:{
                    isToken: false,
                }
            }).then(res=>{
                this.msg=res.data
            })
        },
    },
}
</script>

<style scoped>

</style>
